<?php
{{#models}}
{{#model}}
/**
 * {{classname}}Test
 *
 * PHP version 8.3
 *
 * @category Class
 * @package  {{invokerPackage}}
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

namespace {{invokerPackage}}\Test\Model;

use PHPUnit\Framework\TestCase;
use {{modelPackage}}\{{classname}};

/**
 * {{classname}}Test Class Doc Comment
 *
 * @category    Class
 * @description {{description}}{{^description}}{{classname}}{{/description}}
 * @package     {{invokerPackage}}
 */
class {{classname}}Test extends TestCase
{

    private {{classname}} $model;

    /**
     * Setup before running each test case
     */
    public function setUp(): void
    {
        $this->model = new {{classname}}();
    }

    /**
     * Clean up after running each test case
     */
    public function tearDown(): void
    {
        unset($this->model);
    }

    /**
     * Test "{{classname}}"
     */
    public function test{{classname}}()
    {
        $this->assertInstanceOf({{classname}}::class, $this->model);
    }
{{#vars}}

    /**
     * Test attribute "{{name}}"
     */
    public function testProperty{{nameInPascalCase}}()
    {
        {{#isEnum}}
        $enumInstance = new {{classname}}();
        $allowedValues = $enumInstance->{{getter}}AllowableValues();
        $testValue = reset($allowedValues);
        {{/isEnum}}
        {{^isEnum}}
        {{#isEnumRef}}
        $enumInstance = new {{dataType}}();
        $allowedValues = $enumInstance->getAllowableEnumValues();
        $testValue = reset($allowedValues);
        {{/isEnumRef}}
        {{#isString}}
        $testValue = 'test';
        {{/isString}}
        {{#isInteger}}
        $testValue = 123;
        {{/isInteger}}
        {{#isNumber}}
        $testValue = 1;
        {{/isNumber}}
        {{#isBoolean}}
        $testValue = true;
        {{/isBoolean}}
        {{#isArray}}
        $testValue = [];
        {{/isArray}}
        {{#isMap}}
        $testValue = array();
        {{/isMap}}
        {{^isEnumRef}}{{^isString}}{{^isInteger}}{{^isNumber}}{{^isBoolean}}{{^isArray}}{{^isMap}}
        $testValue = new {{{dataType}}}();
        {{/isMap}}{{/isArray}}{{/isBoolean}}{{/isNumber}}{{/isInteger}}{{/isString}}{{/isEnumRef}}
        {{/isEnum}}
        $this->model->set{{nameInPascalCase}}($testValue);
        $this->assertEquals($testValue, $this->model->get{{nameInPascalCase}}());
    }
{{/vars}}
}
{{/model}}
{{/models}}
